const jwt = require('jsonwebtoken')

let setToken = function(str1,str2){
    let user = str1;   //这里我是把登录账号和密码作为了规则
    let paswd = str2;
    const rule = {
        username: user,
        pwd: paswd
    }
    let scret = 'sunwanbiao123';  //自定义秘钥  自定义，没要求足
    let ztoken = jwt.sign(rule, scret, { expiresIn: 60*60*24 }) 
    return ztoken
}

module.exports = { setToken }
